<template>
  <a-modal
    width="554px"
    centered
    title="解绑详情"
    class="img-preview-modal"
    :visible="visible"
    :closable="false"
    :footer="null"
    :bodyStyle="{padding: '20px'}"
    @cancel="close"
  >
    <badge text="车辆信息" :pdbt="10"/>
    <a-row class="see_row" :gutter="20">
      <a-col :span="12">
        <span class="title-label">车牌号：</span>
        {{queryParams.licensePlate||"-"}}
      </a-col>
      <a-col :span="12">
        <span class="title-label">车架号：</span>
        {{queryParams.vehicleNo||"-"}}
      </a-col>
      <a-col :span="12">
        <span class="title-label">车辆型号：</span>
        {{queryParams.model||"-"}}
      </a-col>
      <a-col :span="12">
        <span class="title-label">运营状态：</span>
        <a-tag v-show="queryParams.vehicleStatus == 0" class="color_jin">闲置中</a-tag>
        <a-tag v-show="queryParams.vehicleStatus == 1" class="color_green">使用中</a-tag>
        <a-tag v-show="queryParams.vehicleStatus == 2" class="color_red">维修中</a-tag>
        <a-tag v-show="queryParams.vehicleStatus == 3" class="color_blue">调度中</a-tag>

      </a-col>
      <a-col :span="12">
        <span class="title-label">归属门店：</span>
        {{queryParams.storeName||"-"}}
      </a-col>
    </a-row>
    <badge text="解绑人信息"  :pdbt="10" :pdbtop="8" />
    <a-row class="see_row" :gutter="20">
      <a-col :span="12">
        <span class="title-label">解绑人：</span>
        {{queryParams.memberName||"-"}}
      </a-col>
      <a-col :span="12">
        <span class="title-label">联系电话：</span>
        {{queryParams.mobile||"-"}}
      </a-col>
      <a-col :span="12">
        <span class="title-label">归属门店：</span>
        {{queryParams.storeName||"-"}}
      </a-col>
      <a-col :span="12">
        <span class="title-label">车辆绑定时间：</span>
        {{queryParams.bindTime||"-"}}
      </a-col>
      <a-col :span="12">
        <span class="title-label">申请时间：</span>
        {{queryParams.createdAt||"-"}}
      </a-col>
    </a-row>
    <a-row>
      <a-col :span="12">
        <span class="title-label">解绑原因：</span>
        {{queryParams.unbindReason||"-"}}
      </a-col>
    </a-row>
    <badge text="申请结果"  :pdbt="10" :pdbtop="10" />
    <a-row class="see_row" :gutter="20">
      <a-col :span="24">
        <span class="title-label">是否同意解绑车辆：</span>
        {{queryParams.status==='COMPLETED'?'是':queryParams.status==='REJECT'?'否':"-"}}
      </a-col>
      <a-col :span="24" style="margin-bottom:0;">
        <span class="title-label">不通过原因：</span>
        {{queryParams.rejectReason||"-"}}
      </a-col>
    </a-row>
  </a-modal>
</template>
<script>
import badge from '@/components/badge'
import { vehicleUnbindOrdersGet } from '@/services/message'

export default {
  components: {
    badge
  },

  data () {
    return {
      visible: false,
      title: '',
      queryParams: {}
    }
  },
  methods: {
    onInitial (id) {
      this.visible = true

      this.carStoreAllList(id)
    },
    async carStoreAllList (id) {
      const res = await vehicleUnbindOrdersGet(id)
      const { isSuccess, data: response, msg } = res
      if (isSuccess) {
        this.queryParams = response
      } else {
        this.$message.newFun(msg, 'error', 2)
      }
    },
    // 关闭
    close () {
      this.visible = false
    }
  }
}
</script>
